﻿using System;
using System.Collections.Generic;

namespace HigLabo.Net.Twitter
{
    /// <summary>
    /// 
    /// </summary>
    public class GetFriendsCommand : TwitterCommand
    {
        private const Int32 MaxCount = 5000;
        private Int32 _Count = 0;
        private Int64 _UserID = 0;
        private String _ScreenName = "";
        private String _Cursor = "";
        private Boolean _StringifyIDs = false;
        /// <summary>
        /// 
        /// </summary>
        public Int32 Count
        {
            get { return _Count; }
            set 
            {
                if (value < 0)
                {
                    throw new ArgumentException();
                }
                if (value > MaxCount)
                {
                    _Count = MaxCount;
                }
                _Count = value;
            }
        }/// <summary>
        /// 
        /// </summary>
        public Int64 UserID
        {
            get { return _UserID; }
            set { _UserID = value; }
        }
        /// <summary>
        /// 
        /// </summary>
        public String ScreenName
        {
            get { return _ScreenName; }
            set { _ScreenName = value; }
        }
        /// <summary>
        /// 
        /// </summary>
        public String Cursor
        {
            get { return _Cursor; }
            set { _Cursor = value; }
        }
        /// <summary>
        /// 
        /// </summary>
        public Boolean StringifyIDs
        {
            get { return _StringifyIDs; }
            set { _StringifyIDs = value; }
        }
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        protected override IDictionary<string, string> CreateParameters()
        {
            Dictionary<String, String> d = new Dictionary<string, string>();
            d["user_id"] = this.UserID.ToString();
            d["screen_name"] = this.ScreenName;
            d["cursor"] = this.Cursor;
            d["stringify_ids"] = this.StringifyIDs.ToString().ToLower();
            d["count"] = this.Count.ToString();
            return d;
        }
    }
}
